#include "Facet.h"

#include <string.h>
#include <fan-llvm/core/Core.h>
#include "Type.h"
#include "UnsupportedErr.h"


Type* Facet_classType = NULL;
VTable* Facet_classVTable = NULL;


/**********************************************
 *
 * Methods and fields
 *
 **********************************************/


/**********************************************
 *
 * Type-system functions
 *
 **********************************************/


Type* Facet_initType(void)
{
  if (Facet_classType == NULL)
  {
    Type* baseType = Obj_initType();
    VTable* vtable = Facet_initVTable();
    Type* type = Type_new("Facet", baseType, vtable, sizeof(Facet), sizeof(FacetVTable));
    Facet_classType = type;
    Facet_initStatic();
  }
  return Facet_classType;
}


VTable* Facet_initVTable(void)
{
  if (Facet_classVTable == NULL)
  {
    VTable* vtable = memoryAlloc(sizeof(FacetVTable));
    memcpy(vtable, Obj_initVTable(), sizeof(FanObjVTable));
    Facet_classVTable = vtable;
  }
  return Facet_classVTable;
}


void Facet_initStatic(void)
{
}
